<div id="modal-changecommission" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
	<form class="form-horizontal form" action="{php echo $this->createPluginWebUrl('commission/apply')}" method="post" enctype="multipart/form-data">
		<input type='hidden' name='id' value="{$order['id']}" />
		<input type='hidden' name='op' value='confirmchangecommission' />
		<div class="modal-dialog"  style="width:750px;margin:0px auto;">
			<div class="modal-content" >
				<div class="modal-header">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<h3>修改佣金 订单号: {$order['ordersn']}</h3>
				</div>
				<div class="modal-body">
				<div class="form-group">
							   <label class="col-xs-12 col-sm-3 col-md-2 control-label">粉丝</label>
							   <div class="col-sm-9 col-xs-12">
								   <img src='{$member['avatar']}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc' />
										{$member['nickname']}
							   </div>
						   </div>
						   <div class="form-group">
							   <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员信息</label>
							   <div class="col-sm-9 col-xs-12">
								   <div class='form-control-static'>ID: {$member['id']} 姓名: {$member['realname']} / 手机号: {$member['mobile']} /微信号: {$member['weixin']}</div>
							   </div>
						   </div>
					{php $canchangeall = true;}
					<div class="form-group">

						<div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
							<table class='table'>
								<tr>
									<th style='width:150px;'>商品名称</th>
									<th style='width:50px;'>数量</th>
									<th style='width:80px;'>小计</th>
									{if $set['level']>=1 && !empty($cm1)}
									<th style='width:145px;'>
										1级</th>
									{/if}
									{if $set['level']>=2  && !empty($cm2)}
									<th style='width:145px;'>
										2级</th>
									{/if}
									{if $set['level']>=3  && !empty($cm3)}
									<th style='width:145px;'>
										3级</th>
									{/if}
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td></td>
									{if $set['level']>=1 && !empty($cm1) }
									<td>
										<a href="{php echo $this->createWebUrl('member/list',array('op'=>'detail','id'=>$cm1['id']))}" target='_blank'><img src="{$cm1['avatar']}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm1['nickname']}</a>
										 </td>
									{/if}
									{if $set['level']>=2  && !empty($cm2)}
									<td style='width:100px;'>
										<a href="{php echo $this->createWebUrl('member/list',array('op'=>'detail','id'=>$cm2['id']))}" target='_blank'><img src="{$cm2['avatar']}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm2['nickname']}</a>
										 </td>
									{/if}
									{if $set['level']>=3  && !empty($cm3)}
									<td style='width:100px;'>
										<a  href="{php echo $this->createWebUrl('member/list',array('op'=>'detail','id'=>$cm2['id']))}" target='_blank'><img src="{$cm3['avatar']}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$cm3['nickname']}</a>
										 </td>
									{/if}
								</tr>
								{loop $order_goods_change $goods}
								{if !empty($goods['status1']) ||!empty($goods['status2']) ||!empty($goods['status3'])} {php $canchangeall =false;} {/if}
								<tr>
									<td><img src="{php echo tomedia($goods['thumb'])}" style='width:30px;height:30px;padding:1px;border:1px solid #ccc' /> {$goods['title']}</td>
									<td>{$goods['total']}</td>
									<td>{$goods['realprice']}</td>
									{if $set['level']>=1  && !empty($cm1)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c1']}" {if empty($goods['status1'])}data-canchange="1" data-level="1" name="cm1[{$goods['id']}]"{else}readonly{/if}  /></td>{/if}
									{if $set['level']>=2  && !empty($cm2)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c2']}" {if empty($goods['status2'])}data-canchange="1" data-level="2" name="cm2[{$goods['id']}]"{else}readonly{/if} /></td>{/if}
									{if $set['level']>=3  && !empty($cm3)}<td><input type='text' class='form-control clevel' data-ogid='{$goods['id']}'  value="{$goods['c3']}" {if empty($goods['status3'])}data-canchange="1" data-level="3" name="cm3[{$goods['id']}]"{else}readonly{/if} /></td>{/if}

								</tr>
								<tr>
									<td></td>
									<td></td>
									<td>应得</td>
									{if $set['level']>=1  && !empty($cm1)}<td id='clevel1_sys_{$goods['id']}'>{$goods['co']['level1']}</td>{/if}
									{if $set['level']>=2  && !empty($cm2)}<td id='clevel2_sys_{$goods['id']}'>{$goods['co']['level2']}</td>{/if}
									{if $set['level']>=3  && !empty($cm3)}<td id='clevel3_sys_{$goods['id']}'>{$goods['co']['level3']}</td>{/if}
								</tr>
								{/loop}
							 
								
								
							</table>
						</div>
					</div>
				     <div class="form-group">
							 
							   <div class="col-sm-9 col-xs-12">
								   <div class='form-control-static' style='color:red' >注: 不能修改的佣金为已申请或已结算</div>
							   </div>
						   </div>
					<div id="module-menus"></div>
				</div>
				<div class="modal-footer">
					<a style='float:left' href="javascript:;" class="btn btn-success" onclick='commission_changeall()' >按应得重新设置佣金</a>
					<button type="submit" class="btn btn-primary span2" name="submit" value="yes">确认修改</button>
					<a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
	</form>
</div>
<script language='javascript'>
	function commission_changeall() {
		$('.clevel[data-canchange=1]').each(function(){
		       $(this).val( $('#clevel' + $(this).data('level') + '_sys_' + $(this).data('ogid')).html());
		});
		alert('设置成功， 如果确认无误，点击确认修改即可！')
		 
	}
</script>